<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous" />
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
<div class="container-fluid" id="app">
    <div class="row">
        <div class="col-md-12 text-center" style="background-color: red; color: white" >
            <h3>蜗牛书店</h3>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <ol class="breadcrumb">
                <li v-for="bt in typelist"><a href="javascript:void(0)" :href="'/book/showBookView/?typeid='+bt.id" v-text="bt.name"></a></li>
            </ol>
        </div>

        <div class="col-md-3">
            <form class="form-inline">
                <div class="form-group">
                    <label for="search" class="sr-only">请输入关键词</label>
                    <input type="text" class="form-control" v-model="searchName" id="search" placeholder="请输入关键词">
                </div>
                <button type="button" @click.prevent="search" class="btn btn-default">搜索</button>
            </form>
        </div>

        <div class="col-md-3">
            <button type="button" class="btn btn-default btn-sm">个人中心</button>
            <button type="button" class="btn btn-default btn-sm">我的购物车</button>
            <button type="button" class="btn btn-default btn-sm">我的订单</button>
        </div>
    </div>

    <div class="row">
        <div class="container">

        </div>
    </div>
</div>

<script>
    let vueApp = new Vue({
        el:"#app",
        data:{
            typelist:[],
        },
        methods:{
            initBookType(){
                let _this = this ;
                let url = "/home/typeList" ;
                $.get(url,function (data){
                    console.log(data);
                    _this.typelist = data ;
                },"json")
            }
        },
        created(){
            this.initBookType();
        }
    })
</script>
</body>
</html>